package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.RemarkClient;
import com.tianji.api.dto.remark.LikeTimesQueryDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class RemarkFallbackFactory implements FallbackFactory<RemarkClient> {

    @Override
    public RemarkClient create(Throwable cause) {
        log.error("调用remark服务异常",cause);
        return new RemarkClient() {
            @Override
            public LikeTimesQueryDTO queryByBizTypeAndIds(LikeTimesQueryDTO dto) {
                return new LikeTimesQueryDTO();
            }
        };
    }
}
